package com.aaa.mrcai.controller;

import com.aaa.mrcai.annotion.AAALog;
import com.aaa.mrcai.pojo.vo.OtherVO;
import com.aaa.mrcai.query.StoreQuery;
import com.aaa.mrcai.result.AjaxResult;
import com.aaa.mrcai.service.StoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * TODO
 *
 * @author 惠普
 * @date 2021/12/6  14:48
 */
@RestController
@RequestMapping("store")
public class StoreController {

    @Autowired
    private StoreService storeService;

    @RequestMapping("list")
    public AjaxResult list(StoreQuery query){
        return  storeService.listStore(query);
    }
    @RequestMapping("/getDetail/{id}")
    public AjaxResult getDetail(@PathVariable("id") int id){
        return  storeService.getStoreDetail(id);
    }
    @RequestMapping("listState")
    public AjaxResult listState(){
        return  storeService.listState();
    }
    @RequestMapping("update")
    @AAALog("修改店铺")
    public AjaxResult updateState(StoreQuery query){
        return  storeService.updateState(query);
    }

    @RequestMapping("addOther")
    @AAALog("添加店铺其他信息")
    public AjaxResult addOther(OtherVO otherVO){
        return  storeService.addOther(otherVO);
    }

}
